package com.ruoyi.common.utils.math;

import java.math.BigDecimal;

/**
 * @author ：wang.j.f
 * @description：TODO
 * @date ：Created in 2021/8/27 10:48
 * @modified By：
 * @version: 1.0$
 */
public class MathUtils {

    public static BigDecimal divide(Long source, Long divisor, Integer scale) {
        BigDecimal divide = BigDecimal.valueOf(source).divide(BigDecimal.valueOf(divisor), scale == null ? 2 : scale, BigDecimal.ROUND_HALF_UP);
        return divide;
    }

    public static void main(String[] args) {
    }
}
